<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<%@ include file="/WEB-INF/jsp/header.jsp" %>

<script language="JavaScript"> 
	document.getElementById('finder').style.display = 'block';
</script>

<%@ include file="/WEB-INF/jsp/partnerTools.jsp" %>

<h2> Houses </h2>

<h3> Last update: <c:out value="${updateTime}"/> ago </h3>

<table class="searchTable">
	<form:form method="POST" commandName="houseSearchCriteria">
	<tr>
		<td>
			Max. wellness houses only:
		</td>
		<td>
			<form:checkbox path="maxWellness"/>
		</td>
	</tr>
	<tr>
		<td>
			Select quality:
		</td>
		<td>
			<form:select path="qualityFilter">
				<form:options itemLabel="name"/>
			</form:select>
		</td>
	</tr>
	<tr>
		<td>
			Select country:
		</td>
		<td>
			<form:select path="country">
				<form:option value="">All countries</form:option>
				<form:options  itemLabel="name" />
			</form:select>
		</td>

	</tr>
	<tr>
		<td>
			Select alliance:
		</td>
		<td>
			<form:select path="alliance">
				<form:options  itemLabel="name" />
			</form:select>
		</td>

	</tr>
	<tr>
		<td colspan="2">
			<center><input type="submit" value="Show Houses"></center>
		</td>
	</tr>
	</form:form>
</table>
<br/>



<%@ include file="/WEB-INF/jsp/commercials.jsp" %>




<table width="800" border="2" cellpadding="2" cellspacing="0" bordercolor="777777" width="800" style="text-align: center; font-size: 11px">
	
		<tr style="background: #c0c0c0"> 
			<td>Country (alliance)</td> 
			<td>Durability (days) <br/> <img src="http://www.erepublik.com/images/icons/industry/3/part_walls.png"/></td>
			<td> Wellness <img src="http://www.erepublik.com/images/modules/timemanagement/wellness_small.png"/> </td> 
			<td> Quantity </td> 
			<td> Local price</td>
			<td> Price in gold </td>
			<td> Total restored wellness<br/>
				<img src="http://www.erepublik.com/images/icons/industry/3/part_walls.png"/> *
				<img src="http://www.erepublik.com/images/modules/timemanagement/wellness_small.png"/> 
			</td>
			<td> <b>Wellness for 1g</b> <br/>
			     <img src="http://www.erepublik.com/images/modules/timemanagement/wellness_small.png"/> / 
			   <img src="http://34all.org/erep/gold.gif"/>
			</td>
			
			<td> Company </td>
			<td> Company location (alliance) </td>
		</tr>
	
		<c:forEach var="product" items="${products}" >
			<tr style="background: none repeat scroll 0% 0% <c:out value="${product.country.alliance.color}"/>;">
			<td> 
				<img src="http://www.erepublik.com/images/flags/M/<c:out value="${product.country.urlName}"/>.gif"/><br/>
				<c:out value="${product.country.name}"/> (<c:out value="${product.country.alliance.name}"/>)
			</td>
			<td>
				<c:out value="${product.durability}"/>
			</td>
						<td><c:out value="${product.wellness}"/></td>
			<td><c:out value="${product.quantity}"/></td>
			<td><c:out value="${product.price}"/> <c:out value="${product.country.currencyName}"/></td>
			<td>
				<c:out value="${product.priceInGoldFormatted}"/>
				<img src="http://34all.org/erep/gold.gif"/>
			</td>
			<td><c:out value="${product.totalRestoredWellness}"/></td>
			<td><b><c:out value="${product.efficency}"/></b></td>
			<td>
				<img width="32" src="http://www.erepublik.com/images/icons/industry/3/q<c:out value="${product.quality}"/>.png"/><br/>
				<a href="http://economy.erepublik.com/en/company/dupaDupuDUPA/<c:out value="${product.companyOwner.id}"/>" target="_blank">
					<c:out value="${product.companyOwner.name}"/>
				</a>
			</td>
			
			
			<td style="background: none repeat scroll 0% 0% <c:out value="${product.companyOwner.country.alliance.color}"/>;">
				<img src="http://www.erepublik.com/images/flags/M/<c:out value="${product.companyOwner.country.urlName}"/>.gif"/><br/>
				<c:out value="${product.companyOwner.country.name}"/> (<c:out value="${product.companyOwner.country.alliance.name}"/>)
			</td>
			</tr>
		</c:forEach>
</table>


<%@ include file="/WEB-INF/jsp/bottom.jsp" %>

